from django.http.response import HttpResponse
from django.shortcuts import render

from user.models import User

def testdb(request):
    test1 = User(name='JokenWang', address="江苏省南京市江宁区", age=32)
    test1.save()
    return HttpResponse("<p>数据添加成功！</p>")

def index(request):
    user_list = User.objects.all()
    return render(request, 'index.html', {'user_list': user_list})